package com.jiliason.segmentation.repository.localcache;

import com.jiliason.segmentation.repository.localcache.impl.TypesConstantCache;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class LoadMysqlConstant implements ApplicationRunner {

    @Resource
    private TypesConstantCache typesConstantCache;

    @Override
    public void run(ApplicationArguments args) throws Exception {
//        org.slf4j.Logger infolog = org.slf4j.LoggerFactory.getLogger("com.jiliason.segmentation.INFO");
//        LoggerFactory.getLogger("com.jiliason.segmentation.INFO").info(" ======> info info info");
//        LoggerFactory.getLogger("com.jiliason.segmentation.WARN").warn(" ======> warn warn warn");
//        LoggerFactory.getLogger("com.jiliason.segmentation.ERROR").error(" ======> error error error");
//        log.warn(" ======>warn, test! hello world!");
//        log.error(" ======>error, test! hello world!");
        typesConstantCache.load();
    }
}
